#ifndef  __MB_DEBUG_H__
#define  __MB_DEBUG_H__

#include "stdint.h"
#include "stdio.h"

#define MB_DEBUG_ENABLE      1

#define MB_SLAVE             1
#define MB_MASTER            1

void sys_assert_handler(const char *ex_string, const char *func, uint32_t line);

#if MB_DEBUG_ENABLE

#define MB_LOG(type, message)                                                 \
do                                                                            \
{                                                                             \
    if (type)                                                                 \
        printf(message);                                                      \
}                                                                             \
while (0)                                                                     


#define MB_ASSERT(EX)                                                         \
if(!(EX))                                                                     \
{                                                                             \
    sys_assert_handler(#EX, __FUNCTION__, __LINE__);                          \
}

#else
#define MB_LOG(type, message) 
#define MB_ASSERT(EX)   
#endif

#endif
